<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>招聘计划</title>
<script type="text/javascript" src="static/easyui/jquery.min.js"></script>
<script type="text/javascript" src="static/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="static/easyui/locale/easyui-lang-zh_CN.js"></script>
<link rel="stylesheet" href="static/easyui/themes/icon.css">
<link rel="stylesheet" href="static/easyui/themes/metro-red/easyui.css">
</head>
<body>

<style type="text/css">

.hide{
	display: none;
}
	#plan{
		width: 100%;
		margin:auto;
	    overflow-x: auto;
	    margin-top: 5px;
	    border-collapse: collapse;
	    border: 1px solid #e4e7ec;
	    background-color: #fff;
   		color: gray;
   		font-size:12px; 
	}
	#plan thead{
		color: #19AA8D;
	    font-size: 14px;
	    font-weight: 700;
	} 
	#plan th{
		background: #6666661a;
	}
	#plan td{
		border: 1px solid #e4e7ec;
		width: 150px;
		height: 50px;
	}
.datagrid-header-row td{
		background: #E6E6E6;
		color: #19AA9C;
	    font-size: 14px;
	    font-weight: 700;
	    text-align: center;
	}
	.datagrid-row td{
		background: #fff;
		font-size: 12px;
		text-align: center;
	}
.bianji,.look{
		color:white;
		cursor: pointer;
		border:none;
}
.icon-program-bianji{
		padding-left: 20px;
		background:url('static/easyui/themes/icons/bianji.png') no-repeat 5% 50%;
		background-color:#1AB394;
}
.icon-program-chakan{
		padding-left: 20px;
		background:url('static/easyui/themes/icons/chakan.png') no-repeat 5% 50%;
		background-color:#1AB394;
}
.icon-plan-guanbi{
		padding-left: 20px;
		background:url('static/easyui/themes/icons/quxiao.png') no-repeat 5% 50%;
		background-color:#1AB394;
}
#planxiangq{
	width:620px;
	margin:auto;
	border:none;
}
.insertcontents{
	width:600px;
	height:130px;
	margin-top:10px;
}
.insert-left{
	width:240px;
	height:130px;
	float:left;
	margin-left:40px;
}
.insert-right{
	width:260px;
	height:130px;
	float:right;
	margin-right:20px;
}
#creater{
	margin-left:12px;
}
#interviews{
	margin-left:-12px;
}
.finally-anniu{
	margin-right:10px;
	width:100px;
	height:30px;
	float:right;
}
#planclose{
	width:60px;
	background-color:#17AA8D;
	cursor: pointer;
	color:white;
}
#planbianji{
	width:620px;
	margin:auto;
	border:none;
}
.finallythen{
	width:200px;
	height:30px;
	float:right;
}
.closeit,.okit{
	width: 60px;
    background-color: #17AA8D;
    cursor: pointer;
    color: white;
	margin-right: 10px;
}
.icon-program-queding{
	padding-left: 20px;
	background:url('static/easyui/themes/icons/queding.png') no-repeat 5% 50%;
	background-color:#13826B;
}
.planbianji {
	width: 60px;
    background-color: #17AA8D;
    cursor: pointer;
    color: white;
    margin-left:10px;
}
.icon-plan-bianji{
	padding-left: 20px;
	background:url('static/easyui/themes/icons/bianji.png') no-repeat 5% 50%;
	background-color:#13826B;
}
.icon-program-quxiao{
	padding-left: 20px;
	background:url('static/easyui/themes/icons/quxiao.png') no-repeat 5% 50%;
	background-color:#13826B;
}
.icon-plan-chakan{
	padding-left: 20px;
	background:url('static/easyui/themes/icons/queding.png') no-repeat 5% 50%;
	background-color:#13826B;
}
.leftones,.rightones{
	margin-top:15px;
}
#planid,#planming,#planadress,#planmoney,#names,#way,#money{
	width:170px;
}
#starttime,#endtime,#planstart,#planend{
	width:170px;
}
.qiyong,.buqiyong{
		color:white;
		cursor: pointer;
		border:none;
		margin-left:10px;
}
.buqiyong{
		color:white;
		cursor: pointer;
		border:none;
}
#wheathprogram,#wheathlookpro{
		width:400px;
		height:100px;
		margin:auto;
}
.askprogram{	
		width:400px;
		height:30px;
		margin:auto;
		text-align:center;
		color:#1AB394;
		font-size:15px;
		line-height:30px;
}
.answerprogram{
		width:180px;
		height:30px;
		margin:20px auto;
}
#proanno,#proanyes,#prono,#proyes{
		width:60px;
		height:25px;
		cursor: pointer;
		margin-left: 20px;
		background-color:#1AB394;
		color:white;
		border:none;
}
#insertpro{
		width:60px;
		height:22px;
		color:white;
		margin-left:20px;
		margin-top:5px;
		cursor: pointer;
	}
	.icon-program-insert{
		padding-left: 20px;
		border:none;
		background:url('static/easyui/themes/icons/edit_add.png') no-repeat 5% 50%;
	}
</style>
<script type="text/javascript">
function add(text){
	$("#content-admin").panel({
		href:text
	})
}
function xianshi(){
	$("#plan").datagrid({
	    url:'select-plan',
	    columns:[[    
	    	{field:'aa',checkbox:true,title:'选择',width:50},
	    	{field:'rplanid',hidden:true,title:'编号',width:200},
	    	{field:'plan',title:'序号',width:80},
	    	{field:'rplanname',title:'计划名称',width:210},
	    	{field:'Staff_name',title:'计划负责人',width:120},
	    	{field:'depart_name',title:'招聘部门',width:120},
	    	{field:'position_name',title:'招聘职位',width:150},
	    	{field:'rplanway',title:'招聘方式',width:150},
	    	{field:'caozuo',title:'操作',width:280,align:'center',
				formatter: function(value,row,index){					
					return "<input type='button' onclick='lookat("+row.rplanid+")' class='look icon-program-chakan' style='width:90px;height: 20px;margin-left:20px;font-size:12px;border-radius:4px;color:#fff;background-color:#18A689;cursor: pointer;' value='查看详情'/>"+
					"<input type='button' class='planbianji icon-plan-bianji' onclick='planbianji("+row['rplanid']+")' style='width:60px;height: 20px;font-size:12px;border-radius:4px;color:#fff;background-color:#18A689;cursor: pointer;border:none;' value='修改'/>";
				},
			}
	    	]],
	         	pagination:true,
			    pageNumber:1,
			    pageSize:5,
			    pageList:[5,10,15]
	    });

}
//显示表格
xianshi();
//遮罩层隐藏
$("#zhezhao").hide();
//点击查看详情弹框
function lookat(rplanid){
$("#planid").val("");
$("#planming").val("");
$("#planstart").val("");
$("#planend").val("");
$("#planadress").val("");
$("#planrealstarttime").val("");
$("#planrealendtime").val("");
$("#planmoney").val("");   
$("#planrealmoeny").val("");

$("#planxiangq").window("open");
  $("#zhezhao").show();

$.ajax({
	url:"plan-xiangq",
	type:"post",
	data:{ 
		"rplanid":rplanid
	},
	//从数据库获取数据
	success:function(data){
		$("#planid").val(data[0]["rplanid"]);
		$("#planming").val(data[0]["rplanname"]);
		
		var value = data[0]["rplanstart"];
		var values = new Date(value).getFullYear() + '-' + (new Date(value).getMonth() + 1) + '-' + new Date(value).getDate();	
		$("#planstart").datebox('setValue', values);
		
		var value = data[0]["rplanexitend"];
		var values = new Date(value).getFullYear() + '-' + (new Date(value).getMonth() + 1) + '-' + new Date(value).getDate();	
		$("#planend").datebox('setValue', values);
		
		$("#planadress").val(data[0]["rplanplace"]);
		
		var value = data[0]["rplanexitstart"];
		var values = new Date(value).getFullYear() + '-' + (new Date(value).getMonth() + 1) + '-' + new Date(value).getDate();			
		$('#planrealstarttime').datebox('setValue', values);
		
		var value = data[0]["rplanexitend"];
		var values = new Date(value).getFullYear() + '-' + (new Date(value).getMonth() + 1) + '-' + new Date(value).getDate();	
		$("#planrealendtime").datebox('setValue', values);
		
		$("#planmoney").val(data[0]["rplanmoney"]);
		$("#planrealmoeny").val(data[0]["rplanexitmoney"]);
	}
	});
}
//编辑
 $("#zhezhao").hide();
function planbianji(id){
		$("#planbianji").window("open");
		  $("#zhezhao").show();
		  $.ajax({
				url:"plans-allplan",
				type:"get",
				dateType:"json",
				data:{rplanid:id},
				success: function (result) {
					//id
					$("#rplanid").val(result[0]["rplanid"]);	
					//计划名称
					$("#names").val(result[0]["rplanname"]);
					//开始时间
					$("#starttime").datebox("setValue",result[0]["rplanstart"]);
					//结束时间
					$("#endtime").datebox("setValue",result[0]["rplanend"]);
					//招聘方式
					$("#way").val(result[0]["rplanway"]);
				}
			});
			//点击确定
			$("#planok").click(function(){
				var pid = $("#rplanid").val()
				var pname = $("#names").val();
				var pstart = $("#starttime").val();
				var pend = $("#endtime").val();
				var pway = $("#way").val();
				 $.ajax({
					url:"plans-bianjis",
					type:"post",
					data:{
						"rplanid":pid,
						"rplanname":pname,
						"rplanstart":pstart,
						"rplanend":pend,
						"rplanway":pway
					},
					success:function(result){	
						
					}
				}); 
				$("#planbianji").window("close");
				 $("#zhezhao").hide();
			});
	   }
//点击关闭按钮
$("#planclose").click(function(){
   $("#planxiangq").window("close");
   $("#zhezhao").hide();
}); 
//招聘职位中点击新增职位按钮跳转到新增职位的界面
$(".insert-program").click(function(){
	add("recruitaddprogram");
})
/*点击编辑中的取消*/
$("#planno").click(function(){
	$("#planbianji").window("close");
	 $("#zhezhao").hide();
})	
 	//点击窗口自带的关闭按钮关闭窗口(查看详情)
	 /*   $(document).ready(function(){		    
		   $('#planxiangq').window({
		       onBeforeClose:function(){ 
		    	   $("#zhezhao").hide();
		       }
		   });
		}); *//* 
//点击窗口自带的关闭按钮关闭窗口(修改)
$(document).ready(function(){		    
	   $('#planbianji').window({
	       onBeforeClose:function(){ 
	    	   $("#zhezhao").hide();
	       }
	   });
	}); */
</script>   
	<div class="biographical">
		<div class="first-one" style="height:30px;margin:auto;">
			<button id="insertpro" class="insert-program icon-program-insert"></button>
		</div>	
		<div class="second-one">
			<table id="plan" class="easyui-datagrid" data-options="height:300">
			</table>
		</div>
</div>

<!-- 查看详情 -->
<div id="zhezhao" style="width:1366px;height:736px;position:fixed; top:0px;
background: rgba(0, 0, 0, 0.5);text-align:center;left:0;z-index:10;display:none;" >
<div id="planxiangq" class="easyui-window" title="招聘计划详情" data-options="closed:true,minimizable:false,maximizable:false,collapsible:false">
		<div class="insertcontents">
		<div class="insert-left">
			<form id="left" method="post">
				<div class="leftones"><span>计划编号：</span><input type="text" id="planid" name="rplanid" value="${pojos.rplanid }"></div>
				<div class="leftones"><span>计划名称：</span><input type="text" id="planming" name="rplanname" value="${pojos.rplanname }"></div>
				<div class="leftones"><span>开始时间：</span><input type="text" id="planstart" class="easyui-datebox" required="required" name="rplanstart" value="${pojos.rplanstart }"></div>				
			</form>
		</div>
		<div class="insert-right">
			<form id="right" method="post">
				<div class="leftones"><span>结束时间：</span><input type="text" id="planend" class="easyui-datebox" required="required" name="rplanend" value="${pojos.rplanend }"></div>
				<div class="leftones"><span>招聘地点：</span><input type="text" id="planadress" name="rplanplace" value="${pojos.rplanplace }"></div>
			</form>
		</div>
	</div>
	<div class="finally-anniu"><button id="planclose">关闭</button></div>
</div>
</div>

<!-- 编辑-->
<div id="zhezhao" style="width:1366px;height:736px;position:fixed; top:0px;
background: rgba(0, 0, 0, 0.5);text-align:center;left:0;z-index:10;display:none;" >
<div id="planbianji" class="easyui-window" title="编辑招聘计划" data-options="closed:true,minimizable:false,maximizable:false,collapsible:false">
	<div class="insertcontents">
	<input type="hidden" id="rplanid"/>
		<div class="insert-left">
			<form id="left" method="post">
				<div class="leftones"><span>计划名称：</span><input type="text" id="names" name="rplanname" value="${pojos.rplanname }"></div>
				<div class="leftones"><span>开始时间：</span><input type="text" id="starttime" name="rplanstart" class="easyui-datebox" required="required" value="${pojos.rplanstart }"></div>				
			</form>
		</div>
		<div class="insert-right">
			<form id="right" method="post">
				<div class="leftones"><span>结束时间：</span><input type="text" id="endtime" name="rplanend" class="easyui-datebox" required="required" value="${pojos.rplanend }"></div>
				<div class="leftones">
					<span>招聘方式：</span>
						<select id="way" name="rplanway" value="${pojos.rplanway }">
							<option>--请选择--</option>
							<option>校园招聘</option>
							<option>外部招聘</option>
							<option>内部招聘</option>
						</select>
				</div>
			</form>
		</div>
	</div>
	<div class="finallythen">
		<button id="planno" class="closeit icon-program-quxiao">取消</button>
		<button id="planok" class="okit icon-program-queding">确定</button>
	</div>
</div>
</div>
</body>
</html>